<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	request.setCharacterEncoding("UTF-8");
	String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/CoachListPage.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
<link rel="stylesheet" type="text/css" href="<%=path%>/CSS/backLayout.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/CSS/bombBox.css">
<style type="text/css">
input[type=checkbox]{padding:0px; margin:0px; text-align:right;width: 15px}
.gn_name{padding-top: 3px}
.div_zilei{width: 600px;padding-left: 90px;height: 30px}
.tr{height:40px;background: #57a0ff;font-weight: 700}
.tr td{font-size: 14px;color: #ffffff}
.tr_td{height: 40px;}
.tr_td td{border-bottom: 1px solid #ededed;text-align: center;}
tr td:nth-child(1) {font-size: 14px;color: #cccccc}
.date{background: #ffffff;text-align: center;}
.tr_td td:nth-child(1){border-left: 1px solid #cccccc;}
.addTable.deleteTable:HOVER{cursor:pointer;}
.addTable2,.deleteTable2:HOVER{cursor:pointer;}
.fseq,.fseq2{width: 20px;border: 0;text-align: center;color: #cccccc}

#table2 td {
	border-bottom: 1px solid #ededed;
	text-align: center;
}

.jx1 {
	height: 40px
}
.div_input_hang {
	width: 100%;
	height: 40px;
}
.input_hang {
	float: left;
	width: 500px;
	height: 40px;
}
</style>
</head>
<body style="background: #f5f5f5">
<div class="main">
	<div class="weizhi">
	<c:if test="${empty exerciseCarPlan}">
		学员基础资料>>练车时间>>添加
	</c:if>
	<c:if test="${not empty exerciseCarPlan}">
		学员基础资料>>练车时间>>修改
	</c:if>
	</div>
	<div class="div_body" style="box-shadow: 0 0 5px #cccccc;height: 980px">
		<div class="div_form">
		<c:if test="${empty exerciseCarPlan}">
			<form action="<%=path%>/DrivingSys/addExerciseCarPlan" class="form" onsubmit="return submit2();" method="post">
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">驾校&nbsp;:&nbsp;</span>
							<input  type="text" name="name"  value="${department.fnameL2}" readonly="readonly" style="color: gray;"/>
							<input type="hidden" class="stu">
						</div>
						<div class="input_hang">
							<span class="gn_name">编码&nbsp;:&nbsp;</span>
							<input type="text" name="fnumber" value="${fnumber}" readonly="readonly" style="color: gray;" id="fnumber">
						</div>
					</div>
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">名称&nbsp;:&nbsp;</span>
							<input type="text" name="fnameL2" id="fnameL2">
							<span class="required">必填</span>
						</div>
						<div class="input_hang">
							<span class="gn_name">人数&nbsp;:&nbsp;</span>
							<input type="text" name="cfqty" id="cfqty" onblur="cfqty2()">
							<span class="required">必填</span>
						</div>
					</div>
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">描述&nbsp;:&nbsp;</span>
                            <input type="text" name="fdescriptionL2" id="fdescriptionL2">
						</div>
						<div class="input_hang">
							<span class="gn_name">车辆类型&nbsp;:&nbsp;</span>
							<select name="cfcarsize" style="width: 234px;height: 31px" id="cfcarsize">
								<option value="1">小车</option>
								<option value="2">大车</option>
							</select>
						</div>
					</div>
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">科目&nbsp;:&nbsp;</span>
							<select name="cfkemu" style="width: 234px;height: 31px" id="cfkemu">
								<option value="1">科目一</option>
								<option value="2">科目二</option>
								<option value="3">科目三</option>
							</select>
						</div>
						<div class="input_hang">
							<div style="width: 200px;height: 60px;float: left;">
								<span class="gn_name">练车完成&nbsp;:&nbsp;</span> 
								<input type="checkbox" name="cflcwc2" id="cflcwc2" value="0">
								<input type="hidden" name="cflcwc" id="cflcwc">
							</div>
							<div style="width: 200px;height: 60px;float: left;">
								<span class="gn_name">计时预约&nbsp;:&nbsp;</span> 
								<input type="checkbox" name="cftime2" id="cftime2" value="0">
								<input type="hidden" name="cftime" id="cftime">
							</div>
						</div>
					</div>
						<div class="div_zilei" style="padding-left: 110px;">
							<div style="width: 200px;text-align: left;float: left;color: #444444;font-size: 14px;">练车时间&nbsp;:&nbsp;</div>
							<div style="width: 530px;text-align: right;float: left: ;">
								<img src="<%=path%>/image/insert2323.jpg" class="addTable">
								<span style="padding-right: 20px;color: #57a0ff;font-weight: 700;font-size: 14px" class="addTable">添加</span>
								<img src="<%=path%>/image/delete212.png" class="deleteTable">
								<span class="deleteTable" style="color: #57a0ff;font-weight: 700;font-size: 14px" class="deleteTable">删除</span>
							</div>
						</div>
				<div style="overflow:auto;height: 240px;width: 38%;padding-left: 110px">
								<table  width="100%" align="center" id="table1" style="min-height:50px;overflow:hidden;border-spacing:0;">
									<tr  class="tr">
										<td  width="20px"></td>
										<td  width="20px"></td>
										<td width="200px" align="center">练车时间</td>
										<td width="200px" align="center">练车结束时间</td>
									</tr>
								</table>
						</div>
						
						<div class="div_zilei" style="margin-top: 30px; padding-left: 110px;">
							<div style="width: 200px;text-align: left;float: left;color: #444444;font-size: 14px;">添加教练&nbsp;:&nbsp;</div>
							<div style="width: 530px;text-align: right;float: left: ;">
								<img src="<%=path%>/image/insert2323.jpg" class="addTable2">
								<span style="padding-right: 20px;color: #57a0ff;font-weight: 700;font-size: 14px" class="addTable2">添加</span>
								<img src="<%=path%>/image/delete212.png" class="deleteTable2">
								<span  style="color: #57a0ff;font-weight: 700;font-size: 14px" class="deleteTable2">删除</span>
							</div>
						</div>
				<div style="overflow:auto;height: 240px;width: 38%;padding-left: 110px">
								<table  width="100%" align="center" id="table2" style="min-height:50px;overflow:hidden;border-spacing:0;">
									<tr  class="tr">
										<td  width="20px"></td>
										<td  width="20px"></td>
										<td width="200px" align="center">教练</td>
										<td width="200px" align="center">上限人数</td>
									</tr>
								</table>
						</div>
						
				<div class="div_tj" style="margin-left: 105px">
					<div>
						<input onclick="wclc()" class="input_submit bc" value="" id="button_submit" type="submit" style="margin-top: 0px;margin-right: 30px;">
					</div>
					<div>
						<input type="button" class="input_back fh" value="" onclick="back()" style="margin-top: 0px;"/>
					</div>
				</div>
			</form>
		</c:if>
		<c:if test="${not empty exerciseCarPlan}">
			<form action="<%=path%>/DrivingSys/updateExerciseCarPlan" class="form" onsubmit="return submit2();" method="post">
                <input type="hidden" name="delFid" id="delFid" value="">
                <div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">驾校&nbsp;:&nbsp;</span>
							<input  type="text" name="name"  value="${department.fnameL2}" readonly="readonly" style="color: gray;"/>
							<input type="hidden" class="stu">
						</div>
						<div class="input_hang">
							<span class="gn_name">编码&nbsp;:&nbsp;</span>
							<input type="text" name="fnumber" value="${exerciseCarPlan.fnumber}" readonly="readonly" style="color: gray;" id="fnumber">
						</div>
					</div>
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">名称&nbsp;:&nbsp;</span>
							<input type="text" name="fnameL2" id="fnameL2" value="${exerciseCarPlan.fnameL2}">
							<span class="required">必填</span>
						</div>
						<div class="input_hang">
							<span class="gn_name">人数&nbsp;:&nbsp;</span>
							<input type="text" name="cfqty" id="cfqty" onblur="cfqty2()" value="${exerciseCarPlan.cfqty}">
							<span class="required">必填</span>
						</div>
					</div>
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">描述&nbsp;:&nbsp;</span>
                            <input type="text" name="fdescriptionL2" id="fsimplename"
                                   value="${exerciseCarPlan.fdescriptionL2}">
						</div>
						<div class="input_hang">
							<span class="gn_name">车辆类型&nbsp;:&nbsp;</span>
							<select name="cfcarsize" style="width: 234px;height: 31px" id="cfcarsize">
								<c:if test="${exerciseCarPlan.cfcarsize == '1'}">
								<option value="1">小车</option>
								<option value="2">大车</option>
							</c:if>
							<c:if test="${empty exerciseCarPlan.cfcarsize}">
								<option value="1">小车</option>
								<option value="2">大车</option>
							</c:if>
							<c:if test="${exerciseCarPlan.cfcarsize == '2'}">
								<option value="1">小车</option>
								<option value="2" selected="selected">大车</option>
							</c:if>
							</select>
						</div>
					</div>
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">科目&nbsp;:&nbsp;</span>
							<select name="cfkemu" style="width: 234px;height: 31px" id="cfkemu">
								<c:if test="${empty exerciseCarPlan.cfkemu}">
								<option value="1">科目一</option>
								<option value="2">科目二</option>
								<option value="3">科目三</option>
							</c:if>
							<c:if test="${exerciseCarPlan.cfkemu == '1'}">
								<option value="1">科目一</option>
								<option value="2">科目二</option>
								<option value="3">科目三</option>
							</c:if>
							<c:if test="${exerciseCarPlan.cfkemu == '2'}">
								<option value="1">科目一</option>
								<option value="2" selected="selected">科目二</option>
								<option value="3">科目三</option>
							</c:if>
							<c:if test="${exerciseCarPlan.cfkemu == '3'}">
								<option value="1">科目一</option>
								<option value="2">科目二</option>
								<option value="3" selected="selected">科目三</option>
							</c:if>
							</select>
						</div>
						<div class="input_hang">
							<div style="width: 200px;height: 60px;float: left;">
								<span class="gn_name">练车完成&nbsp;:&nbsp;</span> 
								<c:if test="${exerciseCarPlan.cflcwc == '0' }">
									<input type="checkbox" name="cflcwc2" id="cflcwc2" value="0">
								</c:if>
								<c:if test="${exerciseCarPlan.cflcwc == '1' }">
									<input type="checkbox" name="cflcwc2" id="cflcwc2" checked="checked" value="1">
								</c:if>
								<input type="hidden" name="cflcwc" id="cflcwc">
							</div>
							<div style="width: 200px;height: 60px;float: left;">
								<span class="gn_name">计时预约&nbsp;:&nbsp;</span> 
								<c:if test="${exerciseCarPlan.cftime == '0' }">
									<input type="checkbox" name="cftime2" id="cftime2" value="0">
								</c:if>
								<c:if test="${exerciseCarPlan.cftime == '1' }">
									<input type="checkbox" name="cftime2" id="cftime2" checked="checked" value="1">
								</c:if>
								<c:if test="${empty exerciseCarPlan.cftime }">
									<input type="checkbox" name="cftime2" id="cftime2" value="0">
								</c:if>
								<input type="hidden" name="cftime" id="cftime">
								<input type="hidden" name="fid" value="${exerciseCarPlan.fid}">
							</div>
						</div>
					</div>
						<div class="div_zilei">
							<div style="width: 200px;text-align: left;float: left;color: #444444;font-size: 14px;">练车时间&nbsp;:&nbsp;</div>
							<div style="width: 530px;text-align: right;float: left: ;">
								<img src="<%=path%>/image/insert2323.jpg" class="addTable">
								<span style="padding-right: 20px;color: #57a0ff;font-weight: 700;font-size: 14px" class="addTable">添加</span>
								<img src="<%=path%>/image/delete212.png" class="deleteTable">
								<span class="deleteTable" style="color: #57a0ff;font-weight: 700;font-size: 14px" class="deleteTable">删除</span>
							</div>
						</div>
						<div style="overflow:auto;height: 240px;width: 34.8%;padding-left: 90px">
								<table  width="100%" align="center" id="table1" style="min-height:50px;overflow:hidden;border-spacing:0;">
									<tr  class="tr">
										<td  width="20px"></td>
										<td  width="20px"></td>
										<td width="200px" align="center">练车时间</td>
										<td width="200px" align="center">练车结束时间</td>
									</tr>
									<c:forEach items="${exerciseCarPlanEntries}" var="exerciseCarPlanEntrie" varStatus="s">
										<tr align="left" class="tr_td">
                                            <td>
                                                <input type="checkbox" name="check" style="width: 15px">
                                                <input type="hidden" name="fident" value="${exerciseCarPlanEntrie.fid}">
                                            </td>
											<td>
												<input type="text" name="fseq" class="fseq" value="${exerciseCarPlanEntrie.fseq}" readonly='readonly'>
											</td>
											<td>
												<input type="text" name="cfexercisedate" class="date" id="cfexercisedate${exerciseCarPlanEntrie.fseq}" value="${exerciseCarPlanEntrie.cfexercisedate}"
													   onclick="WdatePicker({el:'cfexercisedate${exerciseCarPlanEntrie.fseq}',dateFmt:'yyyy-MM-dd HH:mm:ss'})"
													   onblur='compareTime($(this))'/>
											</td>
											<td>
												<input type="text" name="cfendtime" class="date" id="cfendtime${exerciseCarPlanEntrie.fseq}" value="${exerciseCarPlanEntrie.cfendtime}"
													   onclick="WdatePicker({el:'cfendtime${exerciseCarPlanEntrie.fseq}',dateFmt:'yyyy-MM-dd HH:mm:ss'})"
													   onblur='compareTime($(this))'/></td>
										</tr>
									</c:forEach>
								</table>
						</div>
						
						<div class="div_zilei" style="margin-top: 30px">
							<div style="width: 200px;text-align: left;float: left;color: #444444;font-size: 14px;">添加教练&nbsp;:&nbsp;</div>
							<div style="width: 530px;text-align: right;float: left: ;">
								<img src="/DrivingSys/image/insert2323.jpg" class="addTable2">
								<span style="padding-right: 20px;color: #57a0ff;font-weight: 700;font-size: 14px" class="addTable2">添加</span>
								<img src="/DrivingSys/image/delete212.png" class="deleteTable2">
								<span style="color: #57a0ff;font-weight: 700;font-size: 14px" class="deleteTable2">删除</span>
							</div>
						</div>
						
						<div style="overflow:auto;height: 240px;width: 34.8%;padding-left: 90px">
								<table width="100%" align="center" id="table2" style="min-height:50px;overflow:hidden;border-spacing:0;">
									<tr class="tr">
										<td width="20px"></td>
										<td width="20px"></td>
										<td width="200px" align="center">教练</td>
										<td width="200px" align="center">上限人数</td>
									</tr>
									<c:forEach items="${exerciseCarPlanCoachs}" var="s">
										<tr align="left" class="jx${s.fseq}">
											<td><input type="checkbox" name="check2" style="width: 15px"></td>
											<td><input type="text" name="fseq2" class="fseq2" value="${s.fseq}" readonly="readonly"></td>
											<td>
												<input type="text" name="coachName" class="coachName is_click_ne"
													   onclick="coachid2($(this))" value="${s.coachName}">
												<input type="hidden" name="coachid" class="coachid" value="${s.coachid}">
											</td>
											<td><input type="text" name="maxnum" class="maxnum" onblur="maxnum2($(this))" value="${s.maxnum}"></td>
										</tr>
									</c:forEach>
								</table>
						</div>
				<div class="div_tj" style="margin-left: 105px">
					<div>
						<input onclick="wclc()" class="input_submit bc" value="" id="button_submit" type="submit">
					</div>
					<div>
						<input type="button" class="input_back fh" value="" onclick="back()"/>
					</div>
				</div>
			</form>
		</c:if>
		</div>
	</div>
</div>
</body>
<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
<%@ include file="/WEB-INF/JSP/ajax.jsp"%>
<script type="text/javascript" src="<%=path%>/HoganJS/handlebars-v4.0.11.js"></script>

<script type="text/javascript">

$(document).ready(function(){
	var type = "${type}"
	if(type == null || type == ''){
		
	}else{
        editAlert();
	}
})

//阻止表单提交
function submit2(){
	var name = $("#fnameL2").val();
    var num = $("#cfqty").val();
	if(name == null || name == ''){
		alert("名称不能未空")
		return false
	}
    if (num == null || num == '') {
        alert("人数不能为空")
        return false
    }
    $("input[type='submit']").attr("disabled", "disabled");
}
//添加一行练车时间
$(".addTable").click(function(){
	 var tr_len = $("#table1 tr").length;//表格长度
	 var cfexercisedate = "cfexercisedate";//创建时间name值
	 var cfendtime = "cfendtime";//修改时间name值
	 var cfexercisedateId = cfexercisedate+tr_len;//创建时间id
	 var cfendtimeId = cfendtime+tr_len;//修改时间id
    var str = "<tr align='left' class='tr_td'><td><input type='checkbox' name='check' style='width: 15px'><input type='hidden' name='fident' value='null' ></td><td><input type='text' name='fseq' class='fseq' value=" + tr_len + " readonly='readonly'></td>";
    str += "<td><input type='text' name='cfexercisedate' class='date' id='" + cfexercisedateId + "' onclick=\"WdatePicker({el:'" + cfexercisedateId + "',dateFmt:'yyyy-MM-dd HH:mm:ss'})\" onblur='compareTime($(this))'/></td>"
    str += "<td><input type='text' name='cfendtime' class='date' id='" + cfendtimeId + "' onclick=\"WdatePicker({el:'" + cfendtimeId + "',dateFmt:'yyyy-MM-dd HH:mm:ss'})\" onblur='compareTime($(this))'/></td></tr>";
	 $("#table1").append(str)
})

//比较时间
function compareTime(_this) {
    var startTime, endTime;
    var name = _this.prop("name");
    if (name == 'cfexercisedate') {
        startTime = _this.val();
        endTime = _this.parent().next().find("input").val();
    } else {
        endTime = _this.val();
        startTime = _this.parent().prev().find("input").val();
    }
    if (startTime != '' && endTime != '') {
        var day1 = new Date(startTime);
        var day2 = new Date(endTime);
        if ((day1.getTime() - day2.getTime()) > 0) {
            alert("开始时间不能大于结束时间");
            if (name == 'cfexercisedate') {
                _this.val("");
                _this.parent().next().find("input").val("");
            } else {
                _this.val("");
                _this.parent().prev().find("input").val("");
            }
        }
    }
}
//添加一行教练
$(".addTable2").click(function(){
	 var tr_len = $("#table2 tr").length;//表格长度
	 var str = "<tr align='left' class='jx"+tr_len+"'><td><input type='checkbox' name='check2' style='width: 15px'></td><td><input type='text' name='fseq2' class='fseq2' value="+tr_len+" readonly='readonly'></td>";
    str += "<td><input type='text' name='coachName' class='coachName is_click_ne' onclick='coachid2($(this))'/><input type='hidden' name='coachid' class='coachid'></td>"
	 str += "<td><input type='text' name='maxnum' class='maxnum' onblur = 'maxnum2($(this))'/></td></tr>";
	 $("#table2").append(str)
})
//开启弹框
function coachid2(_this){
	var jx = _this.parent().parent().prop("class");
	$(".stu").val(jx)
	$('#modal-overlay').css('visibility','visible')
	$('.modal-data1').css('visibility','visible')
	$('.xysj input:checkbox').removeAttr('checked');
	$('#index').val(1)
	$('.page').show();
}

var delFid = '';
//删除一行
$(".deleteTable").click(function(){
	var tr_len = $("#table1 tr").length;
	if(tr_len == 1){
		
	}else{
		var s;
		$('input:checkbox[name=check]').each(function(i) {
			if($(this).is(':checked')){
				$(this).parent().parent().remove();
				s = '1';
                delFid += $(this).parent().parent().find("td input:hidden[name=fident]").val() + ",";
			}
		})
		
		//判断是否选中
		if(s == null || s == ''){
			alert("请选择一条数据删除");
			return false;
		}
		//重新排序
		$('#table1 tr td .fseq').each(function(i) {
			var s = i*1 + 1*1;
			$(this).val(s);
			$(this).parent().next().find("input").attr("id",'cfexercisedate'+s);
			$(this).parent().next().find("input").attr("onclick",'WdatePicker({el:"cfexercisedate'+s+'",dateFmt:"yyyy-MM-dd HH:mm:ss"})');
			
			$(this).parent().next().next().find("input").attr("id",'cfendtime'+s);
			$(this).parent().next().next().find("input").attr("onclick",'WdatePicker({el:"cfendtime'+s+'",dateFmt:"yyyy-MM-dd HH:mm:ss"})');
			//$(this).parent().next().next().find("input").eq(1).attr("onclick",'WdatePicker({el:"cfendtime'+s+'",dateFmt:"yyyy-MM-dd HH:mm:ss"})');
		})
        $('#delFid').val(delFid);
	}
})
//选择教练数据
$(".subtn1").live('click',function(){
	var fseq = $(".stu").val();
	var fid;
	var name;
	$('input:checkbox[name=personfid]:checked').each(function (i) {
		if(i == 0){
			fid = $(this).val();
			name = $(this).parent().next().next().text();
		}
	})
	//获取点击的fid
	var oldFid = $('.'+fseq+'').find(".coachName").next().val();
	var flag;
	$('.coachid').each(function (i) {
		var newFid = $(this).val();
		if(oldFid == '' || oldFid == null){
			if(newFid == fid){
				alert("不能重复选择教练")
				flag = '1';
				return false;
			}
		}else{
			if(newFid == oldFid){
				
			}else{
				if(fid == oldFid){
					alert("不能重复选择教练")
					flag = '1';
					return false;
				}
			}
		}
	})
	
	if(flag == '1'){
		return false;
	}
	$('.'+fseq+'').find(".coachName").val(name);
	$('.'+fseq+'').find(".coachName").next().val(fid);
	$('#modal-overlay').css('visibility','hidden')
	$('.modal-data1').css('visibility','hidden')
})

//判断人数
function maxnum2 (_this){
	//获取人数
	var max = $("#cfqty").val();
	//获取最大上限人数
	var rs = 0;
	
	var value = _this.val();
	if(value == '' || value == null){
		alert("上限人数不能未空")
		return false;
	}
	$('.maxnum').each(function (i) {
		var s = $(this).val();
			rs = rs+s*1;
	})
	if(rs > max){
		alert("上限总人数大于练车时间人数");
        return false;
	}
}

//判断人数
function cfqty2(){
	var max = $("#cfqty").val();
	if(max == null || max ==''){
		alert("人数不能为空");
        return false;
	}
	var rs;
	$('.maxnum').each(function (i) {
		var s = $(this).val();
			rs = rs+s*1;
	})
	if(rs > max){
		alert("上限总人数大于练车时间人数");
        return false;
	}
}

//删除一行
$(".deleteTable2").click(function(){
	var tr_len = $("#table2 tr").length;
	if(tr_len == 1){
		
	}else{
		var s;
		$('input:checkbox[name=check2]').each(function(i) {
			if($(this).is(':checked')){
				$(this).parent().parent().remove();
				s = '1';
			}
		})
		
		//判断是否选中
		if(s == null || s == ''){
			alert("请选择一条数据删除");
			return false;
		}
		//重新排序
		$('#table2 tr td .fseq2').each(function(i) {
			var s = i*1 + 1*1;
			$(this).val(s);
			$(this).parent().parent().attr("class","jx"+s)
		})
	}
})	

//只能输入数字
$(".maxnum,#cfqty").live('keyup', function(event){//当键盘按下之后立即校验，并替换当前操作框中的内容 
	if($(this).val() == '0'){
		
	}else{
		$(this).val($(this).val().replace(/\D|^0/g,'')); 
	}
});

function wclc(){
	//判断完成练车是否选中，选中就为1，
	if($('#cflcwc2').is(':checked')) {
		$("#cflcwc").val("1");
	}else{
		$("#cflcwc").val("0");
	}
	//判断计时预约是否选中，选中就为1，
	if($('#cftime2').is(':checked')) {
		$("#cftime").val("1");
	}else{
		$("#cftime").val("0");
	}
}

/* $("#cfqty").blur(function(){
	//只能输入数字和小数点
	var re = /^\d+(?=\.{0,1}\d+$|$)/ 
	//理论油耗的值
	var cfqty = $(this).val();
	//判断只能输入数字和小数点
	if(cfqty == ""){
		$(".jiage").css("display","none");
	}else if(!re.test(cfqty)){
		$(".jiage").css("display","inline");
		$(this).val("")
	}else{
		$(".jiage").css("display","none");
	}
}) */

function back(){
    parent.closeSelectCard()

    //location = 'queryExerciseCarPlan/look.action';
	}
	
/* 关闭弹出框    */
$('.btn').click(function(){
	$('#modal-overlay').css('visibility','hidden')
	$('.modal-data1').css('visibility','hidden')
	$('.page').hide();
	$(".stu").val("")
})
</script>


</html>